package com.qingshu.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qingshu.common.entity.custom.MusicType;
import com.qingshu.common.util.model.FieldUtil;
import com.qingshu.mapper.MusicTypeMapper;
import com.qingshu.service.IMusicTypeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Huzz
 * @since 2021-12-09
 */
@Service
public class MusicTypeServiceImpl extends ServiceImpl<MusicTypeMapper, MusicType> implements IMusicTypeService {

    @Override
    public boolean addMusicType(MusicType model) {
        FieldUtil.setCreatedAndUpdateField(model);
        return this.baseMapper.insert(model) > 0;
    }

    @Override
    public List<MusicType> findMusicTypeAll() {
        return this.baseMapper.selectList(null);
    }
}
